package com.kai.steering.data.service.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableName;
import com.kai.steering.data.service.entity.domainObject.CaretakerDO;
import com.kai.steering.data.service.entity.dto.CaretakerQueryDTO;
import lombok.*;

import java.io.Serializable;

/**
 * <pre>
 * 管理员
 * </pre>
 *
 * @author kai
 * @since 2022-02-23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ToString
@EqualsAndHashCode(callSuper = false)
@TableName(value = "caretaker")

public class Caretaker implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 账号
     */
    @TableId(value = "caretaker_id", type = IdType.ID_WORKER)

    private String caretakerId;


    /**
     * 密码
     */

    private String password;


    /**
     * 用户名
     */

    private String caretakerName;


    /**
     * 用户简介
     */

    private String introduce;


    /**
     * 用户生日期
     */

    private Date birthday;


    /**
     * 管理员id
     */

    private String founder;


    /**
     * 创建日期
     */

    private Date creationDatetime;


    /**
     * 用户电话
     */

    private String phone;


    /**
     * 用户地址
     */

    private String address;


    /**
     * 存在0删除1
     */

    private Integer usable;


    /**
     * 删除日期
     */

    private Date deleteDatetime;


    public Caretaker(CaretakerQueryDTO caretakerQueryDTO) {
        this.caretakerId= caretakerQueryDTO.getCaretakerId();
        this.password= caretakerQueryDTO.getPassword();
        this.caretakerName= caretakerQueryDTO.getCaretakerName();
        this.introduce= caretakerQueryDTO.getIntroduce();
        this.birthday= caretakerQueryDTO.getBirthday();
        this.founder= null;
        this.creationDatetime=null;
        this.phone= caretakerQueryDTO.getPhone();
        this.address= caretakerQueryDTO.getAddress();
        this.deleteDatetime= null;


    }

    public Caretaker(CaretakerDO caretakerDO) {
        this.caretakerId= caretakerDO.getCaretakerId();
        this.password= caretakerDO.getPassword();
        this.caretakerName= caretakerDO.getCaretakerName();
        this.introduce= caretakerDO.getIntroduce();
        this.birthday= caretakerDO.getBirthday();
        this.founder=  caretakerDO.getFounder();;
        this.creationDatetime= caretakerDO.getBirthday();;
        this.phone= caretakerDO.getPhone();
        this.address= caretakerDO.getAddress();
        this.usable=  caretakerDO.getUsable();;
        this.deleteDatetime=  caretakerDO.getDeleteDatetime();;
    }
}
